﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section JsHeader{
    <script type="text/javascript" src="/areas/admin/js/posterntoken.js"></script>
}
<div>
    <div>
        <select name="duration" id="duration" class="small-input">
            <option value="15">15分钟</option>
            <option value="30">30分钟</option>
            <option value="60">60分钟</option>
            <option value="720">半天</option>
        </select>
        <input type="button" class="button" value="生成访问链接" onclick="doCreate();" />
    </div>
    <table>
    <thead>
        <tr>
            <th>
                访问链接
            </th>
            <th>
                开始时间
            </th>
            <th>
                过期时间
            </th>
        </tr>
    </thead>
    <tbody>
        @{
            int index = 0;
            foreach (dynamic posternToken in ViewBag.PosternTokens)
            {
                if (index % 2 == 0)
                {
            <tr>
                <td>@string.Format("http://{0}/?posterntoken={1}", Eleanor.BLL.SettingBLL.Instance.GetWebsiteDomain(), posternToken.PosternToken)</td>
                <td>@posternToken.StartTime</td>
                <td>@posternToken.ExpiredTime</td>
            </tr>
                }
                else
                {
            <tr class="alt-row">
                <td>@string.Format("http://{0}/?posterntoken={1}", Eleanor.BLL.SettingBLL.Instance.GetWebsiteDomain(), posternToken.PosternToken)</td>
                <td>@posternToken.StartTime</td>
                <td>@posternToken.ExpiredTime</td>
            </tr>
                }
                index++;
            }
        }
    </tbody>
</table>
</div>